package com.syzsn.sk8.repository;

import com.syzsn.sk8.entity.SySK8WorldCupGroupRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SySK8WorldCupGroupRecordRepository extends JpaRepository<SySK8WorldCupGroupRecord, String> {

    @Query(value = "select * from SY_SK8_WORLDCUP_GROUP_RECORD where WC_ID=?1 order by GROUP_NAME,id", nativeQuery = true)
    List<SySK8WorldCupGroupRecord> findListByWcId(Integer wcId);

    @Query(value = "select * from SY_SK8_WORLDCUP_GROUP_RECORD where WC_ID=?1 and GROUP_NAME=?2 and COUNTRY1_ID=?3 and COUNTRY2_ID=?4", nativeQuery = true)
    SySK8WorldCupGroupRecord findOneByParam(Integer wcId, String groupName, String country1Id, String country2Id);
}
